//
//  ViewController.m
//  DateAndString
//
//  Created by tianlong on 2018/3/13.
//  Copyright © 2018年 tianlong. All rights reserved.
//

#import "ViewController.h"
#import "DateTool.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSDate *dateNow = [NSDate date];
    NSString *dateToString = [DateTool toTimeStringFromDate:dateNow dateFormatString:@"yyyy-MM-dd hh:mm:ss"];
    NSLog(@"dateToString = %@",dateToString);
    
    NSString *timeString = @"2018-09-09 12:28:39";
    NSDate *stringTodate = [DateTool toDateFromTimeString:timeString dateFormatString:@"yyyy-MM-dd hh:mm:ss"];
    NSLog(@"stringTodate = %@",stringTodate);
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
